package main

import (
	"fmt"
	"regexp"
)

const text = "my email is ccmourse@gmail.com " +
	"email1 is abc@def.com " +
	"email2 is  gggg@qq.com"

func main() {
	//@符号前面应该是数字或者字母,而且不能为空
	re := regexp.MustCompile("([a-zA-Z0-9]+)@([a-zA-Z0-9]+)(\\.[a-zA-Z0-9.]+)")
	match := re.FindAllStringSubmatch(text, -1)
	for _, m := range  match{
		fmt.Println(m)
	}
}
